//
//  YYJLcurriculumCell.m
//  YuanyangJinlou
//
//  Created by mac004 on 2016/12/29.
//  Copyright © 2016年 suli19910309@qq.com. All rights reserved.
//

#import "YYJLcurriculumCell.h"
@interface YYJLcurriculumCell()
{
    UIButton*playBtn;
}
@end
@implementation YYJLcurriculumCell
-(instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        [self creatUI];
    }return self;
}

-(void)creatUI{
    self.picImg=[[UIImageView alloc]initWithFrame:CGRectMake(0,0, 171*PER_WIDTH, 110*PER_HEIGHT)];
    _picImg.image=[UIImage imageNamed:@"xindianjiameng"];
    [self addSubview:_picImg];
    
    self.titleLabel=[MyControl createLabelWithFrame:CGRectMake(0, _picImg.bottom+10*PER_HEIGHT, _picImg.width, 13*PER_HEIGHT) Font:13 Text:@"你妹的测试测试"];
    _titleLabel.textColor=UIColorFromHex(0x333333);
    [self addSubview:_titleLabel];
    
    
    UIImage*img=[UIImage imageNamed:@"ico_bofang"];
    playBtn=[MyControl createButtonWithFrame:CGRectMake(70*PER_WIDTH, 40*PER_HEIGHT, img.size.width*PER_WIDTH,img.size.height*PER_HEIGHT ) ImageName:@"ico_bofang" Target:self Action:@selector(play) Title:@""];
    playBtn.hidden=YES ;
    [self.picImg addSubview:playBtn];
}

-(void)setIsVideo:(BOOL)isVideo{
    _isVideo=isVideo;
    if (_isVideo) {
        playBtn.hidden=NO;
    }else{
        playBtn.hidden=YES;
    }

}
-(void)setDateDic:(NSDictionary *)dateDic{
    _dateDic=dateDic;
    
 }
-(void)play{
    if (_delegate &&[_delegate respondsToSelector:@selector(playVideoOnview:withValue:)]) {
        [_delegate playVideoOnview:self withValue:_dateDic];
    }
}
@end
